#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
ll sum[N], X[N];
ll a[N];

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    sum[1] = X[1] = a[1];
    for (int i = 2; i <= n; i++) sum[i] = sum[i - 1] + a[i], X[i] = X[i - 1] ^ a[i];
    ll ans = 0;
    int l = 1;
    for (int r = 1; r <= n; r++) {
        for (; sum[r] - sum[l - 1] != (X[r] ^ X[l - 1]); l++);
        ans += (r - l + 1);
    }
    printf("%lld\n", ans);
    return 0;
}